package com.ymttest.database.mapping;

import com.ymttest.database.model.FqlMember;
import com.ymttest.database.model.FqlMemberExample;
import java.util.List;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface FqlMemberMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table fqlmember
     *
     * @mbggenerated Mon Jun 24 10:19:44 CST 2019
     */
    @Insert({
        "insert into fqlmember (UserId, FqlOpenId, ",
        "State, NewUserFlag, ",
        "CreditGrantTime, TotalCredit, ",
        "AvailableCredit, UnReplayAmount, ",
        "ReplayDate, MaxOverDue, ",
        "RefreshToken, AccessToken, ",
        "CreateTime, UpdateTime)",
        "values (#{userId,jdbcType=INTEGER}, #{fqlOpenId,jdbcType=VARCHAR}, ",
        "#{state,jdbcType=INTEGER}, #{newUserFlag,jdbcType=INTEGER}, ",
        "#{creditGrantTime,jdbcType=TIMESTAMP}, #{totalCredit,jdbcType=DECIMAL}, ",
        "#{availableCredit,jdbcType=DECIMAL}, #{unReplayAmount,jdbcType=DECIMAL}, ",
        "#{replayDate,jdbcType=TIMESTAMP}, #{maxOverDue,jdbcType=INTEGER}, ",
        "#{refreshToken,jdbcType=VARCHAR}, #{accessToken,jdbcType=VARCHAR}, ",
        "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})"
    })
    int insert(FqlMember record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table fqlmember
     *
     * @mbggenerated Mon Jun 24 10:19:44 CST 2019
     */
    @InsertProvider(type=FqlMemberSqlProvider.class, method="insertSelective")
    int insertSelective(FqlMember record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table fqlmember
     *
     * @mbggenerated Mon Jun 24 10:19:44 CST 2019
     */
    @SelectProvider(type=FqlMemberSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="UserId", property="userId", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="FqlOpenId", property="fqlOpenId", jdbcType=JdbcType.VARCHAR),
        @Result(column="State", property="state", jdbcType=JdbcType.INTEGER),
        @Result(column="NewUserFlag", property="newUserFlag", jdbcType=JdbcType.INTEGER),
        @Result(column="CreditGrantTime", property="creditGrantTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="TotalCredit", property="totalCredit", jdbcType=JdbcType.DECIMAL),
        @Result(column="AvailableCredit", property="availableCredit", jdbcType=JdbcType.DECIMAL),
        @Result(column="UnReplayAmount", property="unReplayAmount", jdbcType=JdbcType.DECIMAL),
        @Result(column="ReplayDate", property="replayDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="MaxOverDue", property="maxOverDue", jdbcType=JdbcType.INTEGER),
        @Result(column="RefreshToken", property="refreshToken", jdbcType=JdbcType.VARCHAR),
        @Result(column="AccessToken", property="accessToken", jdbcType=JdbcType.VARCHAR),
        @Result(column="CreateTime", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="UpdateTime", property="updateTime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<FqlMember> selectByExample(FqlMemberExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table fqlmember
     *
     * @mbggenerated Mon Jun 24 10:19:44 CST 2019
     */
    @UpdateProvider(type=FqlMemberSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(FqlMember record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table fqlmember
     *
     * @mbggenerated Mon Jun 24 10:19:44 CST 2019
     */
    @Update({
        "update fqlmember",
        "set FqlOpenId = #{fqlOpenId,jdbcType=VARCHAR},",
          "State = #{state,jdbcType=INTEGER},",
          "NewUserFlag = #{newUserFlag,jdbcType=INTEGER},",
          "CreditGrantTime = #{creditGrantTime,jdbcType=TIMESTAMP},",
          "TotalCredit = #{totalCredit,jdbcType=DECIMAL},",
          "AvailableCredit = #{availableCredit,jdbcType=DECIMAL},",
          "UnReplayAmount = #{unReplayAmount,jdbcType=DECIMAL},",
          "ReplayDate = #{replayDate,jdbcType=TIMESTAMP},",
          "MaxOverDue = #{maxOverDue,jdbcType=INTEGER},",
          "RefreshToken = #{refreshToken,jdbcType=VARCHAR},",
          "AccessToken = #{accessToken,jdbcType=VARCHAR},",
          "CreateTime = #{createTime,jdbcType=TIMESTAMP},",
          "UpdateTime = #{updateTime,jdbcType=TIMESTAMP}",
        "where UserId = #{userId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(FqlMember record);
}